home *** CD-ROM | disk | FTP | other *** search
- # SpecTcl, by S. A. Uhler
- # Copyright (c) 1994-1995 Sun Microsystems, Inc.
- #
- # See the file "license.txt" for information on usage and redistribution
- # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- #
- # do an about box
- # 1) walk Spec in from the left
- # 2) walk T, c, l in from the right
- # 3) walk magnifying glass in from the right
- # 4) turn each of T, c, l bigger (and red) as the
- # magnifying glass goes by
-
-
- foreach image [array names About] {
- image create bitmap $image -data $About($image)
- }
- catch "unset About"
- proc about {} {
- global Tags P
- if {[winfo exists .about]} return
- toplevel .about
- wm title .about "$P(title) - about"
- # render latent after commands harmless
- bind .about <Destroy> {proc %W args {}}
- set c .about.c
- canvas $c
- blt_table .about .about.c 0,0 -fill both
- set w [image width spec]
- set h [image height spec]
- wm geometry .about [expr 2 * $w]x[expr 200 + $h]
- tkwait visibility .about
-
- # draw "spec"
- set after 0
- $c create image -$w 30 -anchor nw -image spec -tag spec
- for {set i 0} {$i < $w} {incr i 10} {
- after [incr after 100] "$c move spec 10 0"
- }
-
- # draw "tcl"
-
- incr after 500
- set ww [expr 2 * $w + 50]
- set offset $w
- incr offset 35
- set y0 [image height lt]
- incr y0 35
- foreach img {t c l} {
- set indx [$c create image $ww $y0 -anchor sw -image l$img -tag "l$img small"]
- set Tags($indx) $img
- for {set i $ww} {$i > $offset} {incr i -8} {
- after [incr after 50] "$c move l$img -8 0"
- }
- incr offset [image width l$img]
- incr offset 3
- }
-
- # Make "the glass"
-
- $c create oval 0 0 170 170 -width 6 -outline blue \
- -stipple gray25 -fill #88f -tag "glass ring"
- $c create line 140 150 180 200 -width 20 -tag glass
- $c move glass $ww -15
- incr offset -163
- for {set i $ww} {$i > $offset} {incr i -10} {
- after [incr after 75] "$c move glass -10 0; about_check $c"
- }
-
- # now for the text
-
- set message "
- SpecTcl Version 0.1
- by
- Stephen Uhler
- \xa9 Sun Microsystems Laboratories
-
- spectcl@tcl.eng.sun.com
- "
-
- incr after 500
- $c create text $w $h -text $message \
- -justify center -anchor n -tag text
- $c move text 0 200
- for {set i 200} {$i > $h} {incr i -10} {
- after [incr after 75] "$c move text 0 -10"
- }
- incr after 500
- for {set i 200} {$i > $h} {incr i -10} {
- after [incr after 75] "$c move ok 0 -10"
- }
-
- # now go away
-
- button $c.b -text OK -bd 5 -fg blue -command "destroy .about" \
- -highlightthickness 4 -highlightcolor red
- $c create window 20 $h -anchor nw -tag ok -window $c.b
- $c move ok 0 200
- focus $c.b
- # grab .about ;# don't need it
- }
-
- # check the glass entering the letters, and grow them
-
- proc about_check {c} {
- global Tags
- set cover [$c bbox ring]
- set in [eval {$c find enclosed} $cover]
- foreach i $in {
- if {![info exists Tags($i)]} return
- set bbox [$c bbox $i]
- scan [$c bbox $i] "%d %d %d %d" x0 y0 x1 y1
- $c delete $i
- set x [expr ($x0 + $x1)/2]
- set y [expr ($y0 + $y1)/2]
- $c create image $x $y -anchor c -image b$Tags($i)
- after 100 [b$Tags($i) configure -foreground red]
- unset Tags($i)
- $c raise ring
- }
- }
-
-